interface apiParams{
  method: string;
  prefix?: string,
  url: string
}

// let apis = {}
const apiContext = require.context("/", false, /.ts$/)
// console.log("apiContext ==> ", apiContext.keys());
// apiContext.keys().forEach(element => {
//   console.log("element ==. ", element);
//   if(element.startsWith('./index')) return
  
  
//   const module = apiContext(element)
    
//   apis = { ...apis, ...(module.default || module) }
  
// });

const apis = apiContext.keys().reduce((prev, element) : any => {
  if(element.startsWith('./index')) return {...prev}
  const module = apiContext(element)
  return { ...prev, ...(module.default || module)}
},{})

// console.log("apis ==> ", apis);

export default apis